An electric motor may feature a rotor with permanent magnets and a stator, such as an interior permanent magnet (IPM) motor or an IPM synchronous motor. An inverter may control the electric motor or other electric machine, such as an alternating current, variable frequency motor. In certain prior art, the maximum current that can be provided by the inverter to the electric motor is limited by the junction temperatures of the switching devices of the inverter. At stall and low fundamental frequency operation, the current output capability of an inverter is limited to lower output capability than can be achieved at higher fundamental frequency operation. Thus, there is a need for an improved method and inverter with thermal management for controlling an electric machine.